<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script>
      const map = new Map();
      map.set('DDD', 'dsagg');
      map.set('D1', 'd2agg');
      //将map转换为数组
      const arr = Array.from(map);
      const arr2 = [...map];
      console.log(arr);
      const map2 = new Map([['GG', 11]
      , ['dasdsa', 'sdsadas']
      , [{}, () => {}]]
      );
      console.log(map2);
      for (const [key, value] of map2) {
        console.log([key, value]);
      }
      map.forEach((key, value) => {
        console.log(key, value);
      });
    </script>
  </head>
  <body></body>
</html>
